package cn.itcast.producer.sender;

import cn.itcast.producer.domain.User;
import cn.itcast.producer.processor.MyProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
@EnableBinding(MyProcessor.class)
public class MessageSender {

	@Autowired
	@Qualifier("outputOrder")
	MessageChannel output;

	public void send(Object message) {
		output.send(MessageBuilder.withPayload(message).build());
	}
}
